# -*- coding: utf-8 -*-
"""
To run the tests, first install the following packages:

    nose
    nosegae==0.1.7
    webtest
    gaetestbed
    coverage

Then build the project:

    cd project
    python2.5 bootstrap.py
    bin/buildout

Then run from the tests dir:

    python2.5 run_tests.py
"""
import os
import sys

import nose

if __name__ == '__main__':
    base = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    app = os.path.join(base, 'project', 'app')
    distlib = os.path.join(app, 'distlib')
    sys.path[0:0] = [base, distlib]

    params = '-d --with-gae -P --without-sandbox --cover-erase --with-coverage --cover-package=tipfy.ext.auth --gae-application=%s' % app
    argv = [__file__] + params.split()
    nose.run(argv=argv)
